<%include("/common/list-top.html",{title:"物料管理",css:[
ctxPath+"/zui/dist/lib/uploader/zui.uploader.min.css",
ctxPath+"/ztree/css/metroStyle.css",
ctxPath+"/css/basice.css"]}){}
%>

<div class="container-fluid">
    <div class="page-head-nav">
        <div class="row">
            <div class="col-xs-10">
                <ol class="breadcrumb">
                    <li><a href="${ctxPath}"><i class="icon icon-home"></i>工作台</a></li>
					<li>基础数据管理</li>
					<li><a href="${ctxPath}/materiel">物料管理</a></li>
				</ol>
			</div>
			<div class="col-xs-1">
		<a class="btn btn-link"   id="import">物料导入</a>
	</div>
	<div class="col-xs-1">
		<a class="btn btn-link"  id="addMaterielBtn">新增</a>
	</div>
        </div>
    </div>
    
<div class="row">
	<!--物料类型树  -->
	<div class="col-xs-2">
		<div class="panel"  style="margin-right: -10px; margin-left: -10px;">
			<div class="panel-heading">
				<a href="/bartalks/materiel"><i class="icon icon-bolt"></i> <span class="title">物料类型</span></a>
				<div class="panel-actions pull-right">
					<a data-toggle="tooltip" title="新增" id="add" data-original-title="新增">
						<i class="icon icon-file-o"></i>
					</a>
					<a data-toggle="tooltip" title="编辑" id="edit" data-original-title="编辑">
						<i class="icon-pencil"> </i>
					</a>
					<a data-toggle="tooltip" title="删除" id="remove" data-original-title="删除">
						<i class="icon-trash"> </i>
					</a>
				</div>
			</div>
			<div class="panel-body" style="overflow-x: hidden;">
				<input type="hidden" id="long_number">
				<ul id="treeDemo" class="ztree"></ul>
			</div>
		</div>
	</div>


	<!--物料列表 -->
	<div class="col-xs-10">
		<div class="row listui" id="mainUI">
			<div class="col-xs-12 ">
				<#listTable url="/bartalks/materiel"
					fields="materiel_code,物料编码,sort,no-query|materiel_name,物料名称,sort,query|value,价值(元),8%,no-sort,query|length,长(cm),8%,no-sort,query|width,宽(cm),8%,no-sort,query|height,高(cm),8%,no-sort,query|volume,体积(cm³),10%,no-sort,query" />
			</div>
		</div>
	</div>
</div>



<!-- 新增物料类型模态框 -->
<div class="modal fade" id="addMaterielTypeModal">
	<div class="modal-dialog" style="width: 500px;">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal">
					<span aria-hidden="true">×</span><span class="sr-only">关闭</span>
				</button>
				<h4 class="modal-title">新增物料类型</h4>
			</div>
			<div class="modal-body">
				<form class="form-horizontal" id="materielTypeForm">
				
					<input type="hidden" name="parentId" id="parentId">
					
					<input type="hidden" name="longCode" id="addLongCode">
					<div class="row">
							<div class="col-xs-3">
							<label>物料类型编码<span class="color_red"> *</span></label>
						</div>
						<div class="col-xs-6">
							<input type="text" class="form-control" id="addTypeCode" name="typeCode" maxlength="20" placeholder="物料类型编码" >
						</div>
					</div>
					<div class="clearfix"></div>
					<div class="row">
						<div class="col-xs-3">
							<label>物料类型名称<span class="color_red"> *</span></label>
						</div>
						<div class="col-xs-6">
							<input type="text" class="form-control" id="addTypeName" name="typeName" maxlength="20" placeholder="物料类型名称">
						</div>
					</div>
				</form>
			</div>
		</div>
		<div class="modal-footer">
			<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
			<button type="button" class="btn btn-primary" id="save">确定</button>
		</div>
	</div>
</div>



<!-- 编辑物料类型 -->
<div class="modal fade" id="editMaterielTypeModal">
	<div class="modal-dialog" style="width: 500px;">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal">
					<span aria-hidden="true">×</span><span class="sr-only">关闭</span>
				</button>
				<h4 class="modal-title">编辑物料类型</h4>
			</div>
			<div class="modal-body">
				<form class="form-horizontal" id="editMaterielTypeForm">
				
					<div class="row">
						<div class="col-xs-3">
							<label>物料类型编码<span class="color_red"> *</span></label>
						</div>
						<div class="col-xs-6">
							<input type="hidden" name="id" id="id">
							<input type="text" class="form-control" name="typeCode" id="editTypeCode" maxlength="20"  readonly>
						</div>
					</div>
					<div class="clearfix"></div>
					<div class="row">
						<div class="col-xs-3">
							<label>物料类型名称<span class="color_red"> *</span></label>
						</div>
						<div class="col-xs-6">
							<input type="text" class="form-control"  name="typeName" id="editTypeName" maxlength="20" placeholder="物料类型名称">
						</div>
					</div>
				</form>
			</div>
		</div>
		<div class="modal-footer">
			<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
			<button type="button" class="btn btn-primary" id="upate">确定</button>
		</div>
	</div>
</div>

<!-- 新增物料信息 -->
<div class="modal fade" id="addMaterielWind">
	<div class="modal-dialog" style="width: 720px;height:400px;">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal">
					<span aria-hidden="true">×</span><span class="sr-only">关闭</span>
				</button>
				<h4 class="modal-title">新增物料</h4>
			</div>
			<div class="modal-body">
				<form class="form-horizontal" id="addMaterielForm">
					
					<input type="hidden" name='typeId' >
					<input type="hidden" name='typeCode' >
					<input type="hidden" name="longCode" >
					<div class="row">
						<div class="col-xs-2">
							<label>物料编码<span class="color_red"> *</span></label>
						</div>
						<div class="col-xs-4">
							<input type="text" class="form-control" id="materielCode" name="materielCode" maxlength="20" placeholder="物料编码"  >
						</div>
						<div class="col-xs-2">
						<label>物料类型</label></div>
						<div class="col-xs-4">
							<input type="text" class="form-control"  name="typeName" maxlength="20" readonly>
						</div>
					</div>
					<div class="clearfix"></div>
					
					<div class="row">
						<div class="col-xs-2">
							<label>物料名称<span class="color_red"> *</span></label>
						</div>
						<div class="col-xs-4">
							<input type="text" class="form-control" id="materielName" name="materielName" maxlength="20" placeholder="物料名称">
						</div>
						<div class="col-xs-2">
							<label>价值(元)<span class="color_red"> *</span></label>
						</div>
						<div class="col-xs-4">
							<input type="text" class="form-control number" id="value" name="value" maxlength="20" placeholder="物料价值">
						</div>
					</div>
					<div class="clearfix"></div>
					<div class="row">
					<div class="col-xs-2">
						<label>净重(kg)<span
							class="color_red"> *</span></label></div>
						<div class="col-xs-4">
							<input type="text" class="form-control bignumber" id="emptyWeight" name="emptyWeight" maxlength="20" placeholder="净重">
						</div>
					<div class="col-xs-2">
						<label>毛重(kg)<span
							class="color_red"> *</span></label></div>
						<div class="col-xs-4">
							<input type="text" class="form-control bignumber" id="grossWeight" name="grossWeight" maxlength="20" placeholder="毛重">
						</div>
					</div>
					<div class="clearfix"></div>
					<div class="row">
					<div class="col-xs-2">
						<label>长度(cm)<span
							class="color_red"> *</span></label></div>
						<div class="col-xs-4">
							<input type="text" class="form-control number" id="length" name="length" maxlength="20" placeholder="物料长度">
						</div>
					<div class="col-xs-2">
						<label>宽度(cm)<span
							class="color_red"> *</span></label></div>
						<div class="col-xs-4">
							<input type="text" class="form-control number" id="width" name="width" maxlength="20" placeholder="物料宽度">
						</div>
					</div>
					<div class="clearfix"></div>
					<div class="row">
					<div class="col-xs-2">
						<label>高度(cm)<span
							class="color_red"> *</span></label></div>
						<div class="col-xs-4">
							<input type="text" class="form-control number" id="height" name="height" maxlength="20" placeholder="物料高度">
						</div>
					<div class="col-xs-2">
						<label>体积(cm³)<span
							class="color_red"> *</span></label></div>
						<div class="col-xs-4">
							<input type="text" class="form-control bignumber" id="volume" name="volume" maxlength="20" placeholder="物料体积">
						</div>
					</div>
					<div class="clearfix"></div>
					<div class="modal-footer">
						<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
						<button type="button" class="btn btn-primary" id="addMateriel">确定</button>
					</div>
				</form>
			</div>
		</div>
	</div>
</div>


<!-- 编辑物料信息 -->
<div class="modal fade" id="editMaterielWindow">
	<div class="modal-dialog" style="width: 720px;height:400px;">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal">
					<span aria-hidden="true">×</span><span class="sr-only">关闭</span>
				</button>
				<h4 class="modal-title">编辑物料</h4>
			</div>
			<div class="modal-body">
				<form class="form-horizontal" id="editMaterielForm">
					<input type="hidden"  id="edit_id" name="id"  >
					<div class="row">
						<div class="col-xs-2">
						<label>物料编码<span
							class="color_red"> *</span></label></div>
						<div class="col-xs-4">
							<input type="text" class="form-control" id="edit_materiel_code" name="materielCode" maxlength="20" readonly="readonly" >
						</div>
							<div class="col-xs-2">
						<label>物料类型</label></div>
						<div class="col-xs-4">
							<input type="text" class="form-control" id="edit_type_name" name="typeName" maxlength="20" readonly="readonly" >
						</div>
					</div>
					<div class="clearfix"></div>
					<div class="row">
					<div class="col-xs-2">
							<label>物料名称<span
								class="color_red"> *</span>
							</label>
						</div>
						<div class="col-xs-4">
							<input type="text" class="form-control" id="edit_materiel_name" name="materielName" maxlength="20" placeholder="物料名称">
						</div>
					<div class="col-xs-2">
						<label>价值(元)<span
							class="color_red"> *</span></label></div>
						<div class="col-xs-4">
							<input type="text" class="form-control number" id="edit_value" name="value" maxlength="20" placeholder="物料价值">
						</div>
					</div>
					<div class="clearfix"></div>
					<div class="row">
					<div class="col-xs-2">
						<label>净重(kg)<span
							class="color_red"> *</span></label></div>
						<div class="col-xs-4">
							<input type="text" class="form-control bignumber" id="edit_empty_weight" name="emptyWeight" maxlength="20" placeholder="净重">
						</div>
					<div class="col-xs-2">
						<label>毛重(kg)<span
							class="color_red"> *</span></label></div>
						<div class="col-xs-4">
							<input type="text" class="form-control bignumber" id="edit_gross_weight" name="grossWeight" maxlength="20" placeholder="毛重">
						</div>
					</div>
					<div class="clearfix"></div>
					<div class="row">
					<div class="col-xs-2">
						<label>长度(cm)<span
							class="color_red"> *</span></label></div>
						<div class="col-xs-4">
							<input type="text" class="form-control number" id="edit_length" name="length" maxlength="20" placeholder="物料长度">
						</div>
					<div class="col-xs-2">
						<label>宽度(cm)<span
							class="color_red"> *</span></label></div>
						<div class="col-xs-4">
							<input type="text" class="form-control number" id="edit_width" name="width" maxlength="20" placeholder="物料宽度">
						</div>
					</div>
					<div class="clearfix"></div>
					<div class="row">
					<div class="col-xs-2">
						<label>高度(cm)<span
							class="color_red"> *</span></label></div>
						<div class="col-xs-4">
							<input type="text" class="form-control number" id="edit_height" name="height" maxlength="20" placeholder="物料高度">
						</div>
					<div class="col-xs-2">
						<label>体积(cm³)<span
							class="color_red"> *</span></label></div>
						<div class="col-xs-4">
							<input type="text" class="form-control bignumber" id="edit_volume" name="volume" maxlength="20" placeholder="物料体积">
						</div>
					</div>
					<div class="clearfix"></div>
					<div class="modal-footer">
						<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
						<button type="button" class="btn btn-primary" id="editMateriel">确定</button>
					</div>
				</form>
			</div>
		</div>
	</div>
</div>



<!-- 导入弹出框 -->
<div class="modal fade" id="materielImport" tabindex="-1" role="dialog">
	<div class="modal-dialog " style="width: 500px;">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal">
					<span aria-hidden="true">×</span><span class="sr-only">关闭</span>
				</button>
				<h4 class="modal-title">物料导入</h4>
			</div>
			<div class="modal-body">
				    <h5>请先<a href="javascript:void(0)" id="templateDownload" >下载模板</a>,按照格式填写物料信息</h5>
				    <div style="height: 10px;"></div>
			    <div class="row gezi">
			        <div class="col-xs-12">
			            <div id="uploaderExample" class="uploader">
			                <div class="file-list" data-drag-placeholder="请拖拽文件到此处"></div>
			                <button type="button" class="btn btn-primary uploader-btn-browse pull-right"><i class="icon icon-cloud-upload"></i> 物料导入</button>
			                <div style="height: 20px;"></div>
			            </div>
			        </div>
			    </div>

			</div>
		</div>
	</div>
</div>

</div>	

<%include("/common/list-bottom.html",{js:[
ctxPath+"/ztree/js/jquery.ztree.all.min.js",
ctxPath+"/zui/dist/lib/uploader/zui.uploader.min.js",
ctxPath+"/js/basics/materiel-type.js",
ctxPath+"/js/basics/materiel-list.js"]}){} %>